﻿using Coolzon.Web.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Coolzon.UI.Core.Parts.Widgets
{
    /// <summary>
    /// 条件控件工厂
    /// </summary>
    [Obsolete("请使用多参数的重载")]
    public static class TemplateHolderFactory
    {
        //public static ConditionControl Create(
        //    string name,
        //    UI.Part part,
        //    Script.DataSeriesScriptObject dataSeries,
        //    ServiceProxy.DataServiceRef.DataItem dataItem)
        //{
        //    string nameUpper = name.ToUpper();

        //    if (nameUpper == "CONDITIONIMAGE")
        //    {
        //        ConditionControl control = new ConditionImage();
        //        control.Init(part, dataSeries, dataItem);

        //        return control;
        //    }

        //    return null;
        //}

        public static TemplateHolder Create(
            Widget ownerPart,
            DataResult dataResult,
            DataSeries dataSeries,
            DataItem dataItem)
        {
            TemplateHolder control = new TemplateHolder();
            control.Init(ownerPart, dataResult, dataSeries, dataItem);
            return control;
        }
    }
}
